/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.musiclibrary.api.dao;

import cz.muni.fi.pa165.musiclibrary.api.entities.Genre;
import java.util.List;

/**
 *
 * @author Jakub Gavornik, 325377
 */
public interface GenreDAO {
    /**
     * Creates new genre in database
     * @param genre new genre
     * @throws IllegalArgumentException when genre is null
     * @throws IllegalEntityException when genre id is already set
     * @throws IllegalArgumentException when name is not set
     */
    public void createGenre(Genre genre);
    /**
     * Returns list of all genres in DB
     * @return List of genres in DB
     */
    public List<Genre> getAllGenres();
    /**
     * Returns genre selected by ID
     * @param id id of the genre
     * @return selected genre
     * @throws IllegalArgumentException when id is null
     */
    public Genre getGenre(Long id);
    /**
     * Updates existing genre selected by ID and sets new name
     * @param genre new genre
     * @throws IllegalArgumentException when genre is null, or genre id is null, or genre name is null
     * @throws IllegalArgumentException when genre to update is null
     */
    public void updateGenre(Genre genre);
    /**
     * Deletes genre
     * @param genre genre to delete
     * @throws IllegalArgumentException when genre is null or genre id is null
     * @throws IllegalArgumentException when deleting genre whitch doesnt exists
     * @throws IllegalArgumentException when deleting wrong genre
     */
    public void deleteGenre(Genre genre);
}
